#include "common.h"
#include "object.h"
#include "primitives.h"
#include "materials.h"
#include "light.h"
#include "scene.h"
#include "perspective_camera.h"
#include "bmp_output.h"

int main()
{
	Scene scene;
	Sphere sphere1(Vector3(5.0f, 0.0f, 0.0f), 5.0f);
	Sphere sphere2(Vector3(-5.0f, 0.0f, 0.0f), 3.0f);
	MirrorMaterial material(&scene, Color(0.6f, 0.2f, 0.0f));
	DiffuseMaterial material2(&scene, Color::white());

	Object o1(&sphere1, &material);
	Object o2(&sphere2, &material2);
	scene.objects.push_back(o1);
	scene.objects.push_back(o2);

	PointLight light1(&scene, Vector3(0.0f, 9.0f, -5.0f), Color(0.2f, 0.8f,
	0.5f));
	PointLight light2(&scene, Vector3(2.0f, -1.0f, -6.0f), Color(1.0f, 0.1f,
	0.1f));
	scene.lights.push_back(&light1); 
	scene.lights.push_back(&light2);

	BmpOutput output("img.bmp", 800, 600);
	PerspectiveCamera camera(&scene, &output, Vector3(-5.0f, 0.0f, -20.0f),
		Vector3(0.0f, 0.0f, 1.0f), Vector3(0.0f, 1.0f, 0.0f), pi/4.0f);

	camera.raytrace();	
}
